/*
 * File name: WatermarkPageView.java
 * 
 * Description: The watermark page overlay on camera preview.
 *
 * Author: Theobald_wu, contact with wuqizhi@tydtech.com
 * 
 * Date: 2014-6-25   
 * 
 * Copyright (C) 2014 TYD Technology Co.,Ltd.
 * 
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.freeme.cameraplugin.posemode.ui;

import android.content.Context;
import android.view.ViewConfiguration;
import android.widget.ImageView;
import com.freeme.cameraplugin.posemode.model.PosetemInfo;
import com.freeme.cameraplugin.posemode.utils.PoseUtil;

public class PosePageView extends ImageView {
    private PosetemInfo mItemInfo;

    public PosePageView(Context context) {
        super(context);
        ViewConfiguration.get(context);
    }

    public void setPoseItemInfo(PosetemInfo info) {
        mItemInfo = info;
        int mainpart = info.primitiveId;
        if (mainpart != 0) {
            setImageResource(mainpart);
        } else {
            setImageBitmap(PoseUtil.getBitmapByFileUrl(mItemInfo.primitiveUrl));
        }
    }

    public PosetemInfo getPoseItemInfo() {
        return mItemInfo;
    }
}
